'use strict';

/**
 * 课表schema
 */
const mongoose = require('mongoose'), Schema = mongoose.Schema;

const scheduleSchema = new Schema({
    school_name: { type:String }, //在读学校名称
    grade_name: { type:String }, //年级
    class_num: { type:String },//班级编号
    class_name: { type:String },//班级名称
    class_type: { type:String },//项目
    class_teacher: { type:String },//主讲老师
    schedule_num: { type:String },//课表编号
    schedule_name: { type:String }, //课表名称
    class_time_num: { type:String },//课次编号
    class_time_name: { type:String },//课次名称
    class_start_date: { type:Number, required:true },//上课开始日期
    class_end_date: { type:Number, required:true },//结束日期
    on_class_day: {type:Array},//上课星期集合
    class_start_time: { type:String, required:true },//上课时间
    class_end_time: { type:String, required:true },//结束时间

    group_name: { type:String }, //集团名称
    campus_name: { type:String }, //上课校区
    classroom_id: { type:String },//教室id
    classroom_num: { type:String },//教室编号
    classroom_name: { type:String },//教室名称
    /* 
        上课情况
        @param:student_collection
        @demo: [{student_id:1,student_name:'abc',student_num:'123',student_start_time:'',student_end_time:''}]
    */
    student_collection:{ type: Schema.Types.Mixed },//上课情况 
})

module.exports = mongoose.model('ScheduleModel', scheduleSchema, 'schedule')